<template>
    <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="name" label="姓名" width="120"></el-table-column>
        <el-table-column v-for="(dateInfo, index) in dateRangeInfo" :key="index" :prop="dateInfo.prop"
            :label="new Date(dateInfo.date).toLocaleDateString()"></el-table-column>
    </el-table>
</template>
  
<script>
// import moment from 'moment';
export default {
    data() {
        return {
            tableData: [
                { name: 'John', '2023-01-01': '早班', '2023-01-02': '中班', '2023-01-03': '晚班' },
                { name: 'Jane', '2023-01-01': '晚班', '2023-01-02': '早班', '2023-01-03': '中班' },
            ],
            dateRangeInfo: [
                {
                    date: '2023-01-01',
                    prop: '2023-01-01'
                },
                {
                    date: '2023-01-02',
                    prop: '2023-01-02'
                },
                {
                    date: '2023-01-03',
                    prop: '2023-01-03'
                },
            ]
        };
    },
};
</script>